package com.manli.api.controller;

import java.util.Arrays;
import java.util.Map;

import com.manli.api.dto.OrderRefuseApply;
import com.manli.api.pojo.QueryViewOrderGoods;
import com.manli.api.pojo.Result;
import com.manli.api.service.wechat.WechatPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import com.manli.api.base.annotation.Permissions;
import com.manli.api.pojo.QueryParams;
import com.manli.api.dto.ViewOrderGoods;
import com.manli.api.service.ViewOrderGoodsService;

import javax.servlet.http.HttpServletRequest;


/**
 * VIEW
 *
 * @author manli
 * @email 
 * @date 2020-09-10 08:50:43
 */
@Api(value="/viewordergoods", tags="VIEW")
@RestController
@RequestMapping("api/viewordergoods")
public class ViewOrderGoodsController {
    @Autowired
    private ViewOrderGoodsService viewOrderGoodsService;

    @Autowired
    private WechatPayService wechatPayService;

    @ApiOperation(value="微信支付", notes="商户审核退款")
    @Permissions(module = "", privilege = "", typeOfAccess = Permissions.METHOD_LOGIN)
    @RequestMapping(value="/wechatpay/orderRefuseAudit")
    public @ResponseBody Result orderRefuseAudit(@RequestBody OrderRefuseApply refuseApply, HttpServletRequest request) throws Exception {
        return wechatPayService.orderRefuseAudit(refuseApply,request);
    }

    @ApiOperation(value="交易订单", notes="商户交易退款申请记录")
    @Permissions(module = "", privilege = "", typeOfAccess = Permissions.METHOD_LOGIN)
    @RequestMapping(value="/wechatpay/orderRefuseInfo")
    public @ResponseBody Result orderRefuseInfo(@RequestBody QueryViewOrderGoods orderGoods, HttpServletRequest request) throws Exception {
        return viewOrderGoodsService.orderRefuseInfo(orderGoods,request);
    }

    @ApiOperation(value="交易订单", notes="商户交易记录")
    @Permissions(module = "", privilege = "", typeOfAccess = Permissions.METHOD_LOGIN)
    @RequestMapping(value="/wechatpay/queryOrderGoods")
    public @ResponseBody Result queryOrderGoods(@RequestBody QueryViewOrderGoods orderGoods, HttpServletRequest request) throws Exception {
        return viewOrderGoodsService.getMineBranchOrderInfo(orderGoods,request);
    }

}
